{if $session_is_teacher eq 1}
	{if $tasksheet->GetIs_Ready() eq '0'}
		<form method="post" action="?q=tasksheet/edit/{$id}">
			<table>
				<tr><td>Feladatlap :</td><td><input type="text" name="name" value="{$tasksheet->GetName()}"/></td></tr>
				<tr><td>Létrehozás időpontja :</td><td>{$tasksheet->GetDate()}</td></tr>
				<tr><td>Elérhető pontszám :</td><td><input type="text" name="score" value="{$tasksheet->GetTotal_Score()}"/></td></tr>
				<tr><td>Lejárat :</td><td><input onclick="ds_sh(this);" name="expire" value="{$tasksheet->GetExpire()}" readonly="readonly" style="cursor: text; border: black 1px solid;" /></td></tr>
				<tr><td><input type="submit" name="" value="Feladatlap adatainak módosítása" /></td></tr>
				<input type="hidden" name="type" value="task_sheet-{$id}-changeinfo" />
			</table>
		</form>
		<br/>
		{if $is_upload}
		<b>Feladat:</b><textarea rows="5" cols="90" name="0-description">{$tasks[0]['description']}</textarea>
		{if $task_attachment[0]['picture_url'] neq NULL}
			<a href="{$task_attachment[0]['picture_url']}" target="_blank"><img src="{$task_attachment[0]['picture_url']}" height="204"/></a>
			<form method="post" action="?q=tasksheet/edit/{$id}">
				<input type="hidden" name="type" value="{$id}-0-changeimage" />
				<input type="submit" name="" value="Kép lecserélése" />
			</form>
		{else}
			<form method="post" action="?q=tasksheet/edit/{$id}">
				<input type="hidden" name="type" value="{$id}-0-newimage" />
				<input type="submit" name="" value="Új kép hozzáadása" />
			</form>
		{/if}

		{if $task_attachment[0]['video_url'] neq NULL}
			{Tools::get_video($task_attachment[0]['video_url'])}<br />
			<form method="post" action="?q=tasksheet/edit/{$id}">
				<input type="hidden" name="type" value="{$id}-0-changevideo" />
				<input type="submit" name="" value="Video lecserélése" />
			</form>
		{else}
			<form method="post" action="?q=tasksheet/edit/{$id}">
				<input type="hidden" name="type" value="{$id}-0-newvideo" />
				<input type="submit" name="" value="Új video hozzáadása" />
			</form>
		{/if}
		<br />

		{else}
			{for $counter=0 ; $counter < $taskcount ; $counter++}
					<form method="post" action="?q=tasksheet/edit/{$id}">
						<h1><center>{$tasks[$counter]['number']}. Feladat:</center></h1>
						<textarea rows="5" cols="90" name="content">{$tasks[$counter]['description']}</textarea>
						<input type="hidden" name="type" value="task-{$tasks[$counter]['id']}-changedescription" />
						<input type="submit" name="" value="Kérdés módosítása" />
					</form>	
					<form method="post" action="?q=tasksheet/edit/{$id}">
						<input type="hidden" name="type" value="task-{$tasks[$counter]['id']}-deletetask" />
						<input type="submit" name="" value="Feladat törlése" />
					</form>
					<br/>
					{if $task_attachment[$counter]['picture_url'] neq NULL}
						<a href="{$task_attachment[$counter]['picture_url']}" target="_blank"><img src="{$task_attachment[$counter]['picture_url']}" width="250"/></a><br/>
						<form method="post" action="?q=tasksheet/edit/{$id}">
							<input type="hidden" name="type" value="task_sheet_attachment-{$id}-changeimage" />
							<input type="submit" name="" value="Kép lecserélése" />
						</form>
					{else}
						<form method="post" action="?q=tasksheet/edit/{$id}">
							<input type="hidden" name="type" value="task_sheet_attachment-{$id}-newimage" />
							<input type="submit" name="" value="Új kép hozzáadása" />
						</form>		
					{/if}

					{if $task_attachment[$counter]['video_url'] neq NULL}
						{Tools::get_video($task_attachment[$counter]['video_url'])}
						<form method="post" action="?q=tasksheet/edit/{$id}">
							<input type="hidden" name="type" value="task_sheet_attachment-{$id}-changevideo" />
							<input type="submit" name="" value="Video lecserélése" />
						</form>
					{else}	
						<form method="post" action="?q=tasksheet/edit/{$id}">
							<input type="hidden" name="type" value="task_sheet_attachment-{$id}-newvideo" />
							<input type="submit" name="" value="Új video hozzáadása" />
						</form>		
					{/if}
					<br/>
					<h2>{$tasks[$counter]['number']}. Kérdés válaszai: </h2>
					<form method="post" action="?q=tasksheet/edit/{$id}">
					{for $i=0 ; $i<$answercount; $i++}	
						{if $answers[$i]['task_id'] == $tasks[$counter]['id']}
							{if $tasks[$counter]['is_button']==1}
								<input type="radio" id="a" name="correct_radio" value="is_correct-{$answers[$i]['id']}" {if $answers[$i]['is_correct'] eq 1}checked{/if}/> 
							{elseif $tasks[$counter]['is_checkbox']==1}
								<input type="checkbox" id="a" name="correct_checkbox-{$answers[$i]['id']}" value="{$answers[$i]['id']}" {if $answers[$i]['is_correct'] eq 1}checked{/if}/> 
							{/if}
							<input type="text" id="a" name="answer-{$answers[$i]['id']}-description" value="{$answers[$i]['description']}"/>
							<br/>
							<!--<form method="post" action="?q=tasksheet/edit/{$id}">
								<input type="hidden" name="type" value="answer-{$answers[$i]['id']}-deleteanswer" />
								<input type="submit" name="" value="Kérdés törlése" />
							</form>-->
						{/if}		
					{/for}
						<br/>
						<input type="hidden" name="type" value="answer-{$tasks[$counter]['id']}-modifyanswer" />
						<input type="submit" name="" value="Kérdések módosításának mentése" />
					</form>	
					<form method="post" action="?q=tasksheet/edit/{$id}">
						<input type="hidden" name="type" value="answer-{$tasks[$counter]['id']}-newanswer" />
						<input type="submit" name="" value="Új kérdés hozzáadása" />
					</form>	
				<br/>
			{/for}
			<h1><center>Új feladat felvétele:</center></h1>
			<form method="post" action="?q=tasksheet/edit/{$id}">
				<input type="hidden" name="type" value="task-{$id}-newtask" />
				<input type="hidden" name="number" value="{$counter+1}" />
				<input type="hidden" name="is_checkbox" value="1" />
				<input type="hidden" name="is_button" value="0" />
				<input type="submit" name="" value="Többválasztós feladat" />
			</form>
			<br/>
			<form method="post" action="?q=tasksheet/edit/{$id}">
				<input type="hidden" name="type" value="task-{$id}-newtask" />
				<input type="hidden" name="number" value="{$counter+1}" />
				<input type="hidden" name="is_checkbox" value="0" />
				<input type="hidden" name="is_button" value="1" />
				<input type="submit" name="" value="Egyválasztós feladat" />
			</form>					
			<br/>
			<br/>			
		{/if}
		<h2><a href="?q=tasksheet/showall">Vissza</a></h2>
	{else}
	<center>
	<h1>Már véglegesített!</h1>
	<h2><a href="?q=tasksheet/showall">Vissza</a></h2>
	</center>
	{/if}
{else}
<center>
<h1>Ehhez nincs jogosultságod!</h1>
<h2><a href="?q=tasksheet/showall">Vissza</a></h2>
</center>
{/if}